package com.sky.mapper;


import com.sky.entity.Dish;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    public List<Long> getSetmealByDishId(List<Long>dishIds);

    void save(List<SetmealDish> setmealDishes);

    void deleteBySetmealId(List<Long> ids);


    @Select("select * from setmeal_dish where setmeal_id = #{id}")

    List<SetmealDish> getBySetmealId(Long id);


    @Select("select d.* from dish d left join setmeal_dish sd on d.id = sd.dish_id where sd.setmeal_id = #{id}")
    List<Dish> getDish(Long id);


}
